package com.example.demo.controller;

import com.example.demo.model.Student;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class HelloController {

    @GetMapping("hello")
    public String hello(){
        String s2 ="，世界！";
        String s1 = "你好";
        return  s1+s2;
    }

    @GetMapping("stu")
    public Student stu(){
        return  new Student("3","tom");
    }

    //@GetMapping("list")
    public List<Student> list(){
        ArrayList<Student> students = new ArrayList<>();
        students.add(new Student("1","jerry"));
        students.add(new Student("2","jack"));
        return students;
    }
}
